import { ApiProperty } from '@nestjs/swagger';
import {
  IsArray,
  IsNotEmpty,
  IsNumber,
  IsOptional,
  IsString,
  MaxLength,
} from 'class-validator';
import { Job } from 'src/job/entities/job.entity';
import { Tag } from 'src/tag/entities/tag.entity';
export class CreateUserDto {
  // @IsNumber()
  // @MaxLength(4)
  // id: number;
  @ApiProperty({ name: 'name', required: true, description: '用户姓名' })
  @IsString()
  @IsNotEmpty()
  @MaxLength(10)
  name: string;

  @ApiProperty({ name: 'desc', required: true, description: '用户描述' })
  @IsString()
  desc: string;

  @ApiProperty({ name: 'jobIds', description: '用户工作Id列表' })
  @IsOptional()
  @IsArray()
  @IsNumber({}, { each: true })
  jobIds: Job[];

  @ApiProperty({ name: 'tags', description: '用户标签Id列表' })
  @IsOptional()
  @IsArray()
  @IsNumber({}, { each: true })
  tags: Tag[];
}
